import {proxyModule} from 'tscommon/ts/vue/vm.ext';
import {Logout,fetchDailyData,fetchTableData,back2Modify} from 'tsdomain/Store';
import {returnData,fetchData} from 'tscommon/ts/tools/domain';


const {data,onCreate,onDestroy,onReady,onRefresh,onShow,events} = proxyModule({
  data(){
    return {
      errorInfo:[]
    };
  },
  events:{
    async logout(){
      return returnData(await fetchData(Logout,{}),this,false);
    },
    async dailyData(date:string){
      return returnData(await fetchData(fetchDailyData,date),this,[]);
    },
    async fetchTableData(){
      return returnData(await fetchData(fetchTableData,{}),this,{users:[],list:[]});
    },
    async back2Modify(date:string,id:string){
      return returnData(await fetchData(back2Modify,{date,id}),this,false);
    }
  }
});
export  {data,onCreate,onDestroy,onReady,onRefresh,onShow,events};